package server;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

/**
 *
 * @author Alexander Feiertag
 */
public class Server {

    public static void main(String[] args) {
        try {
            LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
            System.out.println("RMI-Registry erfolgreich gestartet");
        } catch (RemoteException e) {
            System.out.println("Fehler beim Starten der Registry: " + e);
        }
        try {
            ManagmentInterface mi = new Managment();
            Naming.rebind("rmi://localhost:1099/Managment", mi);
            System.out.println("Remote-Object gebunden");
        } catch (MalformedURLException | RemoteException ex) {
            System.out.println(ex.getMessage());
        }
    }
}
